import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';

import appConfig from './app.config';
import databaseConfig from './database.config';
import resourceConfig from './resource.config';

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      load: [appConfig, databaseConfig, resourceConfig],
      envFilePath: [
        `src/config/env/.env.${process.env.NODE_ENV}`,
        'src/config/env/.env',
      ],
    }),
  ],
  exports: [ConfigModule],
})
export class AppConfigModule {}
